﻿using Ninject;

namespace Calculator
{
    public class NinjectContainer
    {
        public readonly IKernel NinjectKernel = new StandardKernel();

        public NinjectContainer()
        {
            AddBindings();
        }

        private void AddBindings()
        {
            NinjectKernel.Bind<IOperatorHandler>()
                .To<OperatorHandler>();
            NinjectKernel.Bind<ISymbolHandler>()
                .To<SymbolHandler>();
            NinjectKernel.Bind<IExpressionValidator>()
                .To<ExpressionValidator>();
            NinjectKernel.Bind<InfixExpression>().ToSelf();
            NinjectKernel.Bind<PostfixExpression>().ToSelf();
            NinjectKernel.Bind<MathExpression>().ToSelf();
        }
    }
}